﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CHGK.web.UI;
using CHGK.web.UI.Controllers;
using CHGK.web.UI.Models;
using ChGK.Data;

namespace CHGK.web.UI.Tests.Controllers
{
  /*[TestClass]
    public class HomeControllerTest
    {

        [TestMethod]
        public void Index()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.AreEqual("Welcome to ASP.NET MVC!", result.ViewBag.Message);
        }

        [TestMethod]
        public void AboutExample()
        {
            HomeController controller = new HomeController();
            /* var moq = new Moq.Mock<IDataContext>();
            moq.Setup(m => m.GetData(9))
                .Returns("9");
            controller.DC = moq.Object;
            
            // Действие
            ViewResult result = controller.AboutExample(12) as ViewResult;
       
            // Утверждение
            //Assert.IsNotNull(result);
            //Assert.AreEqual(result.Model.GetType(), typeof(string));
            //Assert.AreEqual(result.Model, "9");

            //moq.VerifyAll();
           
        }
        
        [TestMethod]
        public void AboutValue()
        {
            HomeController controller = new HomeController();

            var moq = new Moq.Mock<IDataContext>();
            moq.Setup(m => m.GetValue(5)).Returns(20);
            controller.DC = moq.Object;

            //Действие
            ViewResult result = controller.AboutValue(5) as ViewResult;

            //Утверждение
            Assert.IsNotNull(result);
            Assert.AreEqual(result.Model.GetType(), typeof(int));
            Assert.AreEqual(result.Model, 20);

            moq.VerifyAll();
        }

        [TestMethod]
        public void AboutGod()
        {
            HomeController controller = new HomeController();

            //Действие
            ViewResult result = controller.AboutGod(21) as ViewResult;

            //Утверждение
            Assert.IsNotNull(result);
            Assert.AreEqual(result.Model, "Tot");
        }

    }*/
}
